package model.xmlconvert;

import model.xmlconvert.ModelChartFactory;
import model.xmlconvert.ModelFlowChart;
import model.xmlconvert.ModelFlowChartComponent;

public class XMLConverte{
	
	static String array[] =
		{"start", "rectangle", "diamond", "rectangle", "rectangle", "rectangle", "end"};
	static String operation[] =
		{"", "x=0", "y < 0", "x++","y += 5", "y =0",""};
	
	public static void main(String a[]){
		
		ModelFlowChart flowchart = new ModelFlowChart();
		
		ModelFlowChartComponent prev = ModelChartFactory.createComponent(array[0]);;
		flowchart.addComponent(prev);
		
		for(int x=1 ; x < array.length ; x++){
			
			ModelFlowChartComponent m1 = ModelChartFactory.createComponent(array[x]);
			flowchart.addComponent(m1);
			m1.setOperation(operation[x]);
			prev.addComponentConnection(m1);
			prev = m1;
		}
	}
}